﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Personages : MonoBehaviour {

	// Use this for initialization
	void Start () {
        GlobalData globalData = GlobalData.Instance;
        //print("count: " + gameManager.PersonageInfo.Count);
        Dictionary<string, ModelInfo> personageInfos = globalData.ScenePersonageInfo[globalData.SceneName];
        foreach (KeyValuePair<string, ModelInfo> keyValuePair in personageInfos) {
            Transform transform = this.transform.Find(keyValuePair.Key);
            ModelInfo modelInfo = keyValuePair.Value;
            //print(modelInfo.name + ": " + modelInfo.Exists);
            modelInfo.UpdateTransform(transform);
            if (modelInfo.Exists) {
                transform.GetComponent<MovingModel>().ShowTitle(transform.name);
            }
        }
	}
	
	// Update is called once per frame
	void Update () {
		
	}

}
